package com.tanhua.manager.jobs;

import com.tanhua.manager.service.LogService;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//@Component
public class LogJob {

    @Autowired
    private LogService logService;
//    @Scheduled(cron = "0 0/30 * * * ?")
    @Scheduled(cron = "0/10 * * * * ?")
    public void analysis(){
//        以天为单位统计 tb_log中的数据 到tb_analysis_by_day
        logService.analysis(DateTime.now().toString("yyyy-MM-dd"));
        System.out.println("analysis的定时任务执行成功..............");
    }
}
